﻿using UnityEngine;
using System.Collections;
using Memo.Electricity.Engine;

namespace Memo.Electricity.Game
{
	public class LightManager : MonoBehaviour
	{
		public GameObject mLightObj;
		private void Start()
		{
			StartCoroutine(Init());
		}

		private IEnumerator Init()
		{
			while (PlayerManager.Inst == null || PlayerManager.Inst.Player1 == null)
				yield return null;
			Instantiate(mLightObj, PlayerManager.Inst.PlayerPos1, Quaternion.identity,
				PlayerManager.Inst.Player1.transform);
			Instantiate(mLightObj, PlayerManager.Inst.PlayerPos2, Quaternion.identity,
				PlayerManager.Inst.Player2.transform);
		}
	}
}
